package com.hesicare.adapter.service.impl;

import com.hesicare.adapter.entity.HisPrescriptionOther;
import com.hesicare.adapter.service.IParseAdviceService;
import com.hesicare.health.worker.DoAdvice;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @author 55097
 */
@Service
public class ParseAdviceServiceImpl implements IParseAdviceService {

    @Autowired
    private DoAdvice doAdvice;

    protected final static Logger log = LoggerFactory.getLogger(ParseAdviceServiceImpl.class);

    @Override
    public void parseAdvice(Object obList) {
        if (obList != null) {
            ArrayList<HisPrescriptionOther> list = (ArrayList<HisPrescriptionOther>) obList;
            list.stream().forEach(hisPrescriptionOther -> {
                doAdvice.doAdvice(hisPrescriptionOther);
            });
        }
    }
}

